namespace GemBox.Spreadsheet
{
    using System;
    using System.Collections;

    public class SpreadsheetHyperlinkCollection : IEnumerable
    {
        internal ArrayList items;
        internal ExcelWorksheet parent;

        internal SpreadsheetHyperlinkCollection(ExcelWorksheet parent)
        {
            this.items = new ArrayList();
            this.parent = parent;
        }

        internal SpreadsheetHyperlinkCollection(ExcelWorksheet parent, SpreadsheetHyperlinkCollection hyperlinkCollection)
        {
            this.items = new ArrayList();
            this.parent = parent;
            foreach (SpreadsheetHyperlink hyperlink in hyperlinkCollection)
            {
                this.items.Add(new SpreadsheetHyperlink(hyperlink));
            }
        }

        internal void Add(SpreadsheetHyperlink hyperlink)
        {
            this.items.Add(hyperlink);
        }

        public void Clear()
        {
            this.items.Clear();
        }

        internal void DeleteInternal(SpreadsheetHyperlink hyperlink)
        {
            this.items.Remove(hyperlink);
        }

        public IEnumerator GetEnumerator()
        {
            return this.items.GetEnumerator();
        }

        public void RemoveAt(int index)
        {
            this.items.RemoveAt(index);
        }

        public int Count
        {
            get
            {
                return this.items.Count;
            }
        }
    }
}
